package com.conferences.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.conferences.dao.UserDAO;
import com.conferences.model.User;
import com.conferences.service.UserService;

@Service("userService")
public class UserServiceImpl implements UserService {

	@Autowired
	UserDAO userDAO;

	@Override
	public User findByUsername(String username) {
		return userDAO.findByUsername(username);
	}

	@Transactional(readOnly = false)
	public void save(User user) {
		userDAO.save(user);
	}
	
	@Override
	public User get(Long id) {
		return userDAO.get(id);
	}
}
